#include<bits/stdc++.h>
using namespace std;
const int N=1e5+1;
int n;
int r[N];
int ans;
bool vis[N];
bool A=true;
int one;
int in()
{
    int t;
    scanf("%d",&t);
    return t;
}
int main()
{
    ios::sync_with_stdio(false);
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    n=in();
    for(int i=1;i<=n;i++){
        r[i]=in();
        if(r[i]==1)one++;
        if(r[i]>2)A=false;
    }
    if(A){
        ans=min(one,n-one);
        cout<<ans<<endl;
        return 0;
    }
    memset(vis,false,sizeof(vis));
    sort(r,r+n+1);
    for(int i=1;i<=n;i++){
        for(int j=i;j<=n;j++){
            if(r[j]>r[i]&&!vis[j]){
                ans++;
                vis[j]=true;
            }
        }
    }
    cout<<(n-ans)<<endl;
    return 0;
}
